Skip to content

Conversation

RemcoSmitsDev
Copy link
Contributor

@RemcoSmitsDev RemcoSmitsDev commented Aug 21, 2025

Closes #21992

Screenshot 2025-08-21 at 18 09 24

Code example:

# Html Tag
<img src="https://picsum.photos/200/300" alt="Description of image" />

# Html Tag with width and height
<img src="https://picsum.photos/200/300" alt="Description of image" width="100" height="200" />

# Html Tag with style attribute with width and height
<img src="https://picsum.photos/200/300" alt="Description of image" style="width: 100px; height: 200px" />

# Normal Tag
![alt text](https://picsum.photos/200/300)

Release Notes:

  • Markdown: Added HTML <img src="/some-image.svg"> tag support

Supported examples:

```markdown
<img src="https://picsum.photos/200/300" alt="Description of image" />

<img src="https://picsum.photos/200/300" alt="Description of image"
width="100" height="200" />

![alt text](https://picsum.photos/200/300) ```
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Aug 21, 2025
@maxdeviant maxdeviant changed the title markdown: Add html img tag support markdown: Add HTML img tag support Aug 21, 2025
@RemcoSmitsDev RemcoSmitsDev marked this pull request as draft August 22, 2025 17:21
@RemcoSmitsDev RemcoSmitsDev marked this pull request as ready for review August 23, 2025 14:45
@RemcoSmitsDev RemcoSmitsDev requested a review from huacnlee August 23, 2025 14:47
@RemcoSmitsDev
Copy link
Contributor Author

In a follow-up PR, we can support other HTML elements and add better support for HTML text.

@huacnlee
Copy link
Contributor

I feel the other parts are OK. Based on the current adjustments, MarkdownPreview can easily support more HTML formats little by little on this basis.

@RemcoSmitsDev RemcoSmitsDev requested a review from huacnlee August 25, 2025 05:47
@RemcoSmitsDev RemcoSmitsDev force-pushed the markdown-add-html-image-support branch from 0b83442 to e606e2e Compare August 25, 2025 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

preview markdown support for html <img> tags for images
2 participants